package com.thread.signal.first;

/**
 * @description:
 * @author: 刘建楼
 * @create: 2021-04-20
 **/
public class DepositThread3 extends Thread {

    private Account3 account3;
    // 当前取钱线程所希望取的钱数
    private double depositAmount;

    public DepositThread3(String name, Account3 account3, double depositAmount) {
        super(name);
        this.account3 = account3;
        this.depositAmount = depositAmount;
    }

    // 执行100次存操作
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            account3.deposit(depositAmount);
        }
    }

}
